<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/css/shoppingInfo.css}">
    <script language="JavaScript" th:src="@{/script/index.js}"></script>
<!--    <script language="JavaScript" src="../static/script/index.js"></script>-->
</head>
<body>

    <div class="shopping_container">

        <div class="title">
            <label>欢迎来到LW商城</label>
            <a th:href="@{|/page/${1}/${session.user.getUserId()}|}">|返回首页</a>
            <a th:href="@{/ownerInfo}">|个人信息</a>
            <a th:onclick="cart()">我的购物车</a>
        </div>

        <div class="context">
            <div class="shopping_Info_title">
                <h1>商品信息</h1>

            </div>

            <div class="shopping">
                <div class="shopping_img">
                    <img th:src="@{|/userImg/${productBase.productImg}|}"/>
                </div>

                <div class="shopping_type">
                    <div class="price">
                        <div>
                            <label>价格</label><br>
                            <span th:text="${productBase.productPrice}">200元</span>
                        </div>
                        <div>
                            <label>销量</label><br>
                            <span th:text="${productBase.sellNum}">200元</span>
                        </div>
                    </div>
                    <div class="choose_size">
                        <label>选择尺寸</label>
                        <form th:action="@{/asv}" method="post">
                        </form>
                    </div>
                    <div class="choose_type">
                        <label>选择类型</label>
                        <form th:action="@{/asv}" method="post">
                        </form>
                    </div>
                </div>

                <input th:if="${productBase.getProductCount() > 0}" id="input1" type="submit" value="购买"
                       th:onclick="|shoppingInfoPurchase(${productBase.getProductId()})|">
                <input th:if="${productBase.getProductCount() <= 0}" disabled="disabled" id="input2" type="submit" value="库存紧缺"
                       th:onclick="|shoppingInfoPurchase(${productBase.getProductId()})|">
                <input class="input2" type="submit" value="收藏"
                        th:onclick="|shoppingInfoCollect(${productBase.getProductId()})|">
                <input id="car_input" class="input2" type="submit" value="加入购物车"
                        th:onclick="|shoppingInfoJoinCart(${productBase.getProductId()})|">
            </div>

            <div class="shopping_evaluate_title">
                <h1>评论</h1>
            </div>
            <div class="shopping_evaluate_basicInfo">
                <span th:text="|有${evaluateList.size()}条评论|">有20条评论</span>
                <span>点击查看</span>
            </div>


<!--            -->
            <div class="shopping_evaluate_list">

                <div class="shopping_list">
                    <div class="list_ele" th:each="evaluate : ${evaluateList}" th:object="${evaluate}">
                        <div class="user_evaluate">
                            <img th:src="@{|/userImg/*{user.getUserImg()}|}">
                            <p th:text="*{user.getUserName()}">用户名</p>
                            <span th:text="*{evaluateDate}">评价时间</span>
                        </div>

                        <div class="evaluate_context">
                            <span th:text="*{getEvaluateContext()}">
                                这个商品特别好，我很喜欢
                            </span>
                        </div>
                    </div>
                </div>
            </div>

            <div class="my_evaluate">
                <div class="my_evaluate_text">
                    <label>我的评论</label>
                </div>
                <form th:action="@{|/user/evaluateProduct/${productBase.getProductId()}|}" method="post">
                    <textarea id="text_evaluate" class="context_input" name="text" cols="30" rows="3" ></textarea>
                    <button type="submit">评论</button>
                </form>
            </div>
        </div>
    </div>
</body>
</html>


